package org.abc.program.entity;

import org.springframework.stereotype.Component;

/**
 * 菜单实体类
 */
@Component
public class Menu {
	private Long id;  // 编号
	private Long parentId;  //父类id(从数据库获取)
	private Long _parentId; //父类id,用来匹配easyui的父类id
	private String name; //菜单名称
	private String url;  //点击后的url
	private String icon;  //菜单icon图表

	public Menu() {
	}

	public Menu(Long id, Long parentId, Long _parentId, String name, String url, String icon) {
		this.id = id;
		this.parentId = parentId;
		this._parentId = _parentId;
		this.name = name;
		this.url = url;
		this.icon = icon;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public Long get_parentId() {
		this._parentId = this.parentId;  // 实现树形菜单，把数据库中的父节点的Id赋值给下划线的Id
		return _parentId;
	}

	public void set_parentId(Long _parentId) {
		this._parentId = _parentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	@Override
	public String toString() {
		return "Menu{" +
				"id=" + id +
				", parentId=" + parentId +
				", _parentId=" + _parentId +
				", name='" + name + '\'' +
				", url='" + url + '\'' +
				", icon='" + icon + '\'' +
				'}';
	}
}
